-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Cypress on Travis #7201
[WIP] Cypress on Travis #7201
Conversation
3a1cceb
to
c6c64df
Compare
07e1b4c
to
b8075a4
Compare
edbff5c
to
65de6ff
Compare
c9e9889
to
76fb010
Compare
desc "Run all cypress specs" | ||
task :cypress => ["app:cypress:ui:run"] | ||
|
||
namespace :cypress do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For those who might re-reviewing this again, this section was mostly to running get things running via manageiq-cross_repo-tests
PR I have been using:
ManageIQ/manageiq-cross_repo-tests#150
I was trying to write too much bash scripting inside of environment variables, so this was a much easier way to not only debug, but also my idea standardize things a bit using rake
.
That said, this probably won't be needed if we are running things from this repo, and I expect this is probably not a preferred way of doing things by most, so we can remove this once the core changes have been merged. I can always archive this commit somewhere to consider as an option in the future.
if Rails.root | ||
require "manageiq/integration" | ||
|
||
ManageIQ::Integration::CypressRakeTask.new(:ui) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also noticed that this file got... well way smaller.
The logic for this now lives in ManageIQ/manageiq
as part of this PR:
I figured if other plugins what to implement cypress
testing, this should be shared code and easily repeatable.
Allows asset-compile tasks to run properly from manageiq-ui-classic, allowing the full `cypress` test suite tasks to be invoked from there as well.
Adds a new set of rake tasks for setting up and running cypress. Makes use of the `integration:*` rake tasks from core to leverage running a server in the background.
Disables screenshots when running in travis. cypress.env.json generation --------------------------- Cypress handles environment variables itself, so `process.env` isn't available. As a result, "Option 2" is what is being done from here: https://docs.cypress.io/guides/guides/environment-variables.html#Option-2-cypress-env-json which makes sure a default config file exists as part of the `setup` step for running the specs. A `file` task is used here to only run it if the file doesn't exist, but makes it a dependency for the `:setup` task. By default, screenshots are disabled in CI, but enabled in dev. The cypress.env.json file is also ignored by git, so local edits can happen and can be customized for each developer. On CI, it will just be copied in and the defaults from `.cypress.ci.env.json` will be what is configured in that environment
Just a helper task for executing the cypress:specs (intended for CI)
- Install node for spec:cypress - Do an app:cypress:ui:seed instead of update:ui The app:cypress:ui:seed handles compiling assets, so that would be duplicate work to run it twice.
Because I am tired of doing `bash -l`... for cross repo tests... Edit: Well... apparently it is required for anything `nvm` related... Edit 2: `nvm` seems to install then use, so just makes sense to have this as one step. Edit 3: `nvm` is a function, so have to source it first... ugh Edit 4: Set PATH for node. Add spec:cypress:ci exec task (sets path) Edit 5: Debugging... Edit 6: Forgot to add `../bin`... derp Edit 7: Call seed prior to spec:cypress to avoid DB loaded errors "DB loaded errors come from the following task: app:test:verify_no_db_access_loading_rails_environment
Breaks the file into multiple files of two different categories: - commands - assertions
853b22f
to
0b81ff8
Compare
Checked commits NickLaMuro/manageiq-ui-classic@0904e07~...0b81ff8 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint Rakefile
|
This pull request is not mergeable. Please rebase and repush. |
Now that the move from Travis to GHA is nearly complete, should this be closed or updated for GHA? |
Good question - I'll have to re-review it |
Just jumping in for some context... but it has also been a minute (👋 ) I think this branch is built on top of #7194 which is just getting the UI able to run Cypress in general. I think if you wanted to start from somewhere, you could use that branch as a base. That said, This is a 2+ year old branch, so you probably aren't going to loose anything much by starting from scratch. 🙂 |
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
V2 of this PR: #6683
Currenty have some spec fixes to make it "less red", and will remove before merge. Won't merge until we have a passing suite, so this is just getting some of the setup code in place to allow this on CI.
Links
Steps for Testing/QA
Is travis green?